create table jms_dm.dm_cusc_customer_abnormal_waybill_detail_dt
(
    customer_code               varchar(100) comment '客户编码',
    customer_network_code       varchar(100) comment '客户所属网点code',
    waybill_no                  varchar(100) comment '运单',
    deliver_aging_sign_difftime varchar(100) comment '派签时间差',
    proble_type_subject_code    varchar(100) comment '一级类型code41遗失 27破损 35被污染 999其他',
    proble_type_subject_name    varchar(100) comment '一级类型name',
    no_taketimely_flag          int comment '1未及时揽收',
    no_collect_flag             int comment '1不准点交件票',
    false_taking_flag           int comment '1虚假揽收',
    no_outtimely_flag           int comment '1出港不及时',
    no_signtimely_flag          int comment '1未及时签收',
    complaint_flag              int comment '1客诉量',
    sign_difftime_flag          int comment '1网点出仓',
    problem_flag                int comment '1问题件',
    order_id                    varchar(100) comment '订单号',
    customer_id                 varchar(100) comment '客户id',
    customer_name               varchar(100) comment '客户名称',
    customer_network_name       varchar(100) comment '客户所属网点name',
    order_source_code           varchar(100) comment '订单来源code',
    order_source_name           varchar(100) comment '订单来源名称',
    input_time                  varchar(100) comment '订单录入时间',
    way_input_time              varchar(100) comment '运单录入时间',
    deliver_early_scantime      varchar(100) comment '宽表第一次派件时间',
    sign_early_scantime         varchar(100) comment '宽表第一次签收时间',
    taking_early_scansitecode   varchar(100) comment '宽表最早揽收网点',
    taking_early_scansitename   varchar(100) comment '宽表最早揽收网点name',
    sign_code                   varchar(100) comment '宽表第一次签收网点',
    sign_name                   varchar(100) comment '宽表第一次签收网点name',
    customer_fran_code          varchar(100) comment '客户所属加盟商code',
    customer_fran_name          varchar(100) comment '客户所属加盟商name',
    customer_agent_code         varchar(100) comment '客户所属代理区code',
    customer_agent_name         varchar(100) comment '客户所属代理区name',
    start_fran_code             varchar(100) comment '始发网点加盟商code',
    start_fran_name             varchar(100) comment '始发网点加盟商name',
    start_agent_code            varchar(100) comment '始发网点代理区code',
    start_agent_name            varchar(100) comment '始发网点代理区name',
    start_provider_id           varchar(100) comment '始发网点省id',
    start_provider_desc         varchar(100) comment '始发网点省name',
    start_city_id               varchar(100) comment '始发网点市id',
    start_city_desc             varchar(100) comment '始发网点市name',
    start_area_id               varchar(100) comment '始发网点区id',
    start_area_desc             varchar(100) comment '始发网点区name',
    end_fran_code               varchar(100) comment '目的网点加盟商code',
    end_fran_name               varchar(100) comment '目的网点加盟商name',
    end_agent_code              varchar(100) comment '目的网点代理区code',
    end_agent_name              varchar(100) comment '目的网点代理区name',
    end_virt_code               varchar(100) comment '目的网点代理区name',
    end_virt_name               varchar(100) comment '目的网点代理区name',
    end_provider_id             varchar(100) comment '目的网点省id',
    end_provider_desc           varchar(100) comment '目的网点省name',
    end_city_id                 varchar(100) comment '目的网点市id',
    end_city_desc               varchar(100) comment '目的网点市name',
    end_area_id                 varchar(100) comment '目的网点区id',
    end_area_desc               varchar(100) comment '目的网点区name',
    date_time                   date comment '日期'
)ENGINE = OLAP DUPLICATE KEY(customer_code, customer_network_code )
comment '智兔app-客户异动运单明细'
PARTITION BY RANGE(date_time)
(START ("2023-07-01") END ("2023-08-20") EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(waybill_no) BUCKETS 4
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "4",
"in_memory" = "false",
"storage_format" = "V2"
);



